package com.lin.mybatis.aop;

import java.util.Optional;

/**
 * @author linjiang
 * @date 2024/7/6
 * @fn
 */
public class TenantContext {
    static ThreadLocal<Boolean> ignoreTenant = new ThreadLocal<>();

    public static void set(Boolean v) {
        ignoreTenant.set(v);
    }

    public static boolean get() {
        return Optional.ofNullable(ignoreTenant.get()).orElse(false);
    }

    public static void clear() {
        System.out.println("清除。。。");
        ignoreTenant.remove();
    }
}
